<?php

/**
 * LectureNote form base class.
 *
 * @package    FinalsClub
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BaseLectureNoteForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'user_id'        => new sfWidgetFormPropelChoice(array('model' => 'User', 'add_empty' => false)),
      'course_id'      => new sfWidgetFormPropelChoice(array('model' => 'Course', 'add_empty' => true)),
      'number'         => new sfWidgetFormInput(),
      'lecturer_name'  => new sfWidgetFormInput(),
      'lecturer_email' => new sfWidgetFormInput(),
      'topic'          => new sfWidgetFormInput(),
      'notes'          => new sfWidgetFormTextarea(),
      'summary'        => new sfWidgetFormTextarea(),
      'tags'           => new sfWidgetFormInput(),
      'visibility'     => new sfWidgetFormInput(),
      'lectured_at'    => new sfWidgetFormDate(),
      'created_at'     => new sfWidgetFormDateTime(),
      'updated_at'     => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorPropelChoice(array('model' => 'LectureNote', 'column' => 'id', 'required' => false)),
      'user_id'        => new sfValidatorPropelChoice(array('model' => 'User', 'column' => 'id')),
      'course_id'      => new sfValidatorPropelChoice(array('model' => 'Course', 'column' => 'id', 'required' => false)),
      'number'         => new sfValidatorString(array('max_length' => 40, 'required' => false)),
      'lecturer_name'  => new sfValidatorString(array('max_length' => 60, 'required' => false)),
      'lecturer_email' => new sfValidatorString(array('max_length' => 128, 'required' => false)),
      'topic'          => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'notes'          => new sfValidatorString(array('required' => false)),
      'summary'        => new sfValidatorString(array('required' => false)),
      'tags'           => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'visibility'     => new sfValidatorInteger(array('required' => false)),
      'lectured_at'    => new sfValidatorDate(array('required' => false)),
      'created_at'     => new sfValidatorDateTime(array('required' => false)),
      'updated_at'     => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('lecture_note[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'LectureNote';
  }


}
